﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using System.Xml;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Plumbing;
using Autodesk.Revit.UI;
using YArchitech.Controls;
using YArchitech.LIB;
using YArchitech.LIB.YJKControls;
using HyDrawSelectArea;
using HyMaterialStatistic;
using HYView;
using Transfer.Utils;

namespace PlumbingMaterialStatistic
{
	public partial class DlgPlumbingFilter : DlgMaterialStatisticParent
	{
		public DlgPlumbingFilter(ExternalCommandData commandData, PlumbingRequestHandler handler, ExternalEvent exEvent)
		{
			this.InitializeComponent();
			new YJKProcessTools().ShowInTaskbarChange(this);
			this.m_cmmdData = commandData;
			this.m_doc = commandData.Application.ActiveUIDocument.Document;
			this.m_Data = new PlumbingMaterialStatisticData(this.m_doc);
			this.m_Handler = handler;
			this.m_ExEvent = exEvent;
		}

		private bool InitialMaterial()
		{
			this.treeViewMaterial.Nodes.Clear();
			TreeNode treeNode = this.treeViewMaterial.Nodes.Add("管段");
			foreach (Element element in new FilteredElementCollector(this.m_doc).OfClass(typeof(PipeSegment)).OfCategory(BuiltInCategory.OST_PipeSegments).ToElements().ToList<Element>())
			{
				treeNode.Nodes.Add(element.Name);
			}
			this.treeViewMaterial.ExpandAll();
			this.treeViewMaterial.SelectedNode = treeNode;
			return true;
		}

		private bool InitialTreeSystem()
		{
			this.treeViewSystem.Nodes.Clear();
			TreeNode treeNode = this.treeViewSystem.Nodes.Add("管道系统");
			foreach (Element element in new FilteredElementCollector(this.m_doc).OfClass(typeof(PipingSystemType)).OfCategory(BuiltInCategory.OST_PipingSystem).ToElements().ToList<Element>())
			{
				treeNode.Nodes.Add(element.Name);
			}
			this.treeViewSystem.ExpandAll();
			this.treeViewSystem.SelectedNode = treeNode;
			return true;
		}

		private bool InitialTreeElement()
		{
			XmlDocument xmlDocument = new XmlDocument();
			try
			{
				xmlDocument.Load(this.m_strFilePath);
			}
			catch
			{
				YJKMessageBox.Show("缺少配置文件");
				return false;
			}
			XmlNode documentElement = xmlDocument.DocumentElement;
			TreeNode treeNode = this.treeViewElement.Nodes.Add("构件类别");
			foreach (object obj in documentElement.SelectNodes("Element"))
			{
				XmlNode xmlNode = (XmlNode)obj;
				TreeNode treeNode2 = treeNode.Nodes.Add((xmlNode as XmlElement).GetAttribute("Name"));
				FilterInfo nodeTag = this.GetNodeTag(xmlNode);
				treeNode2.Tag = nodeTag;
			}
			this.treeViewElement.ExpandAll();
			this.treeViewElement.SelectedNode = treeNode;
			return true;
		}

		private FilterInfo GetNodeTag(XmlNode xmlNode)
		{
			XmlElement xmlElement = xmlNode as XmlElement;
			if (!xmlElement.HasAttribute("Class"))
			{
				return null;
			}
			string attribute = xmlElement.GetAttribute("Name");
			string attribute2 = xmlElement.GetAttribute("Class");
			string attribute3 = xmlElement.GetAttribute("Category");
			uint nValueType = Convert.ToUInt32(xmlElement.GetAttribute("Type"));
			string attribute4 = xmlElement.GetAttribute("BuiltInParameter");
			string attribute5 = xmlElement.GetAttribute("Unit");
			uint nAmount = Convert.ToUInt32(xmlElement.GetAttribute("Amount"));
			string attribute6 = xmlElement.GetAttribute("Material");
			bool bLg = Convert.ToBoolean(xmlElement.GetAttribute("Lg"));
			string attribute7 = xmlElement.GetAttribute("ConSymbol");
			string attribute8 = xmlElement.GetAttribute("Ps");
			return new FilterInfo(attribute, attribute2, attribute3, nValueType, attribute4, attribute5, nAmount, attribute6, bLg, attribute7, attribute8);
		}

		private void btnOk_Click(object sender, EventArgs e)
		{
			this.MakeRequest(GridRequestId.FilterOk);
		}

		public bool btnOk_Click()
		{
			if (this.m_Data.m_lstDicElement.Count > 0)
			{
				base.lstDicElems.Clear();
				foreach (Dictionary<ElementId, ElemParm> dictionary in this.m_Data.m_lstDicElement)
				{
					Dictionary<int, SatatisticDataInfo> dictionary2 = new Dictionary<int, SatatisticDataInfo>();
					foreach (KeyValuePair<ElementId, ElemParm> keyValuePair in dictionary)
					{
						dictionary2.Add(keyValuePair.Key.IntegerValue, new SatatisticDataInfo(keyValuePair.Value.FamilyName, keyValuePair.Value.Name, keyValuePair.Value.Unit, keyValuePair.Value.DetailInfo, keyValuePair.Value.Amount, keyValuePair.Value.Ps, keyValuePair.Value.FilterType));
					}
					base.lstDicElems.Add(dictionary2);
				}
				base.Hide();
				return true;
			}
			this.m_lstPipeMaterial.Clear();
			this.GetPipeMaterial(false);
			if (this.m_lstPipeMaterial.Count <= 0)
			{
				this.GetPipeMaterial(true);
			}
			this.m_lstSystem.Clear();
			this.GetFilterSystem(this.treeViewSystem.Nodes[0], false, ref this.m_lstSystem);
			if (this.m_lstSystem.Count <= 0)
			{
				this.GetFilterSystem(this.treeViewSystem.Nodes[0], true, ref this.m_lstSystem);
			}
			this.m_lstFilterInfo.Clear();
			this.GetFilterElement(this.treeViewElement.Nodes[0]);
			if (this.m_lstFilterInfo.Count <= 0)
			{
				YJKMessageBox.Show("没有选择构件类别");
				return false;
			}
			if (this.rdoArea.Checked)
			{
				this.m_Data.GetStatisticElement(this.m_doc.ActiveView as ViewPlan, this.m_lstFilterInfo, this.m_lstSystem, this.m_lstSelElems, this.m_lstPipeMaterial);
			}
			else
			{
				this.m_Data.GetStatisticElement(base.bLink, this.m_lstViewPlan, this.m_lstFilterInfo, this.m_lstSystem, this.m_lstPipeMaterial);
			}
			base.lstDicElems.Clear();
			foreach (Dictionary<ElementId, ElemParm> dictionary3 in this.m_Data.m_lstDicElement)
			{
				Dictionary<int, SatatisticDataInfo> dictionary4 = new Dictionary<int, SatatisticDataInfo>();
				foreach (KeyValuePair<ElementId, ElemParm> keyValuePair2 in dictionary3)
				{
					dictionary4.Add(keyValuePair2.Key.IntegerValue, new SatatisticDataInfo(keyValuePair2.Value.FamilyName, keyValuePair2.Value.Name, keyValuePair2.Value.Unit, keyValuePair2.Value.DetailInfo, keyValuePair2.Value.Amount, keyValuePair2.Value.Ps, keyValuePair2.Value.FilterType));
				}
				base.lstDicElems.Add(dictionary4);
			}
			if (base.lstDicElems.Count <= 0)
			{
				YJKMessageBox.Show("没有统计数据");
				base.DialogResult = DialogResult.None;
			}
			base.Hide();
			return true;
		}

		private void btnCancel_Click(object sender, EventArgs e)
		{
			this.MakeRequest(GridRequestId.FilterCancel);
		}

		private List<string> GetDetailFilter(bool bSize)
		{
			List<string> list = new List<string>();
			foreach (Dictionary<ElementId, ElemParm> dictionary in this.m_Data.m_lstDicElement)
			{
				foreach (KeyValuePair<ElementId, ElemParm> keyValuePair in dictionary)
				{
					if (!list.Contains(keyValuePair.Value.DetailInfo))
					{
						list.Add(keyValuePair.Value.DetailInfo);
					}
				}
				if (bSize)
				{
					base.ListDataSort(ref list);
				}
			}
			return list;
		}

		private void DlgPlumbingFilter_Load(object sender, EventArgs e)
		{
			base.Icon = Resource.YArchitechIcon;
			if (!this.InitialMaterial())
			{
				return;
			}
			if (!this.InitialTreeSystem())
			{
				return;
			}
			if (!this.InitialTreeElement())
			{
				return;
			}
			this.chkFilter.Enabled = false;
			this.chkFilter.Checked = false;
			this.UpdateDetailFilter(false);
			this.rdoProject.Checked = true;
			this.m_lstViewPlan = FloorSelectManager.GetAllFloorViewPlan(this.m_doc);
		}

		private void treeViewSystem_AfterCheck(object sender, TreeViewEventArgs e)
		{
			if (e.Action == TreeViewAction.ByMouse)
			{
				this.SetChildChecked(e.Node);
				if (e.Node.Parent != null)
				{
					this.SetParentChecked(e.Node);
				}
			}
		}

		private void treeViewElement_AfterCheck(object sender, TreeViewEventArgs e)
		{
			if (e.Action == TreeViewAction.ByMouse)
			{
				this.SetChildChecked(e.Node);
				if (e.Node.Parent != null)
				{
					this.SetParentChecked(e.Node);
				}
			}
			int num = 0;
			this.TreeViewSingleCheck(this.treeViewElement.Nodes[0], ref num);
			if (num != 1)
			{
				this.chkFilter.Enabled = false;
			}
			else
			{
				this.chkFilter.Enabled = true;
			}
			this.UpdateDetailFilter(this.chkFilter.Enabled);
		}

		private void TreeViewSingleCheck(TreeNode node, ref int nCheck)
		{
			if (nCheck > 1)
			{
				return;
			}
			if (node.Nodes.Count != 0)
			{
				IEnumerator enumerator = node.Nodes.GetEnumerator();
				{
					while (enumerator.MoveNext())
					{
						object obj = enumerator.Current;
						TreeNode node2 = (TreeNode)obj;
						this.TreeViewSingleCheck(node2, ref nCheck);
					}
					return;
				}
			}
			if (node.Checked)
			{
				nCheck++;
				this.m_treNodeCur = node;
			}
		}

		private void SetParentChecked(TreeNode childNode)
		{
			TreeNode parent = childNode.Parent;
			if (!parent.Checked && childNode.Checked)
			{
				int num = 0;
				for (int i = 0; i < parent.GetNodeCount(false); i++)
				{
					if (parent.Nodes[i].Checked)
					{
						num++;
					}
				}
				if (num == parent.GetNodeCount(false))
				{
					parent.Checked = true;
					if (parent.Parent != null)
					{
						this.SetParentChecked(parent);
						return;
					}
				}
			}
			else if (parent.Checked && !childNode.Checked)
			{
				parent.Checked = false;
			}
		}

		private void SetChildChecked(TreeNode parentNode)
		{
			for (int i = 0; i < parentNode.GetNodeCount(false); i++)
			{
				TreeNode treeNode = parentNode.Nodes[i];
				treeNode.Checked = parentNode.Checked;
				if (treeNode.GetNodeCount(false) > 0)
				{
					this.SetChildChecked(treeNode);
				}
			}
		}

		private void rdoProject_Click(object sender, EventArgs e)
		{
			this.m_lstViewPlan.Clear();
			this.m_lstViewPlan = FloorSelectManager.GetAllFloorViewPlan(this.m_doc);
		}

		private void rdoFloors_Click(object sender, EventArgs e)
		{
			if (this.m_lstSelElems != null)
			{
				this.m_lstSelElems.Clear();
			}
			base.Hide();
			List<Level> levels = new List<Level>();
			if (FloorSelectManager.SelectLevel(this.m_doc, ref levels, null))
			{
				this.UpdateViewPlan(levels);
			}
			base.Show();
		}

		private void UpdateViewPlan(List<Level> levels)
		{
			this.m_lstViewPlan.Clear();
			if (levels.Count <= 0)
			{
				return;
			}
			List<ViewPlan> list = new List<ViewPlan>();
			List<double> list2 = new List<double>();
			foreach (Element element in new FilteredElementCollector(this.m_doc).OfClass(typeof(ViewPlan)))
			{
				ViewPlan viewPlan = element as ViewPlan;
				if (viewPlan != null && (int)viewPlan.ViewType == 1 && viewPlan.GenLevel != null)
				{
					list2.Add(viewPlan.GenLevel.Elevation);
					list.Add(viewPlan);
				}
			}
			for (int i = 0; i < levels.Count; i++)
			{
				for (int j = 0; j < list2.Count; j++)
				{
					if (Geometry.IsEqual(levels[i].Elevation, list2[j]))
					{
						this.m_lstViewPlan.Add(list[j]);
					}
				}
			}
		}

		private void rdoArea_Click(object sender, EventArgs e)
		{
			this.MakeRequest(GridRequestId.SelectArea);
		}

		public void SelectStatisticArea()
		{
			if (this.m_lstSelElems != null)
			{
				this.m_lstSelElems.Clear();
			}
			base.Hide();
			CmdViewType types = CmdViewType.FloorPlan;
			if (SwitchView.SetUsableView(types, this.m_cmmdData) != Autodesk.Revit.UI.Result.Succeeded)
			{
				YJKMessageBox.Show("请在平面视图中框选区域");
				return;
			}
			if (SelectAreaManager._hWndRevit == null)
			{
				SelectAreaManager._hWndRevit = base.m_mainSetDlg._hWndRevit;
			}
			try
			{
				SelectAreaManager selectAreaManager = new SelectAreaManager(this.m_cmmdData);
				if (selectAreaManager.EditOutLine() != null)
				{
					YJKMessageBox.Show("选择区域失败");
				}
				if (selectAreaManager.m_lstDetailCurveId.Count <= 0)
				{
					base.Show();
					return;
				}
				CollectSelAreaElement collectSelAreaElement = new CollectSelAreaElement(this.m_cmmdData.Application);
				this.m_lstSelElems = collectSelAreaElement.CollectAllElementInArea(base.bLink, this.m_doc.ActiveView, selectAreaManager.m_lstDetailCurveId);
				this.DeleteSelectLine(selectAreaManager.m_lstDetailCurveId);
			}
			catch
			{
				YJKMessageBox.Show("选择区域失败");
			}
			base.Show();
		}

		public void DeleteSelectLine(List<ElementId> lstSelLineId)
		{
			Transaction transaction = new Transaction(this.m_doc, "Delete SelArea Line");
			transaction.Start();
			try
			{
				this.m_doc.Delete(lstSelLineId);
				transaction.Commit();
			}
			catch
			{
				transaction.RollBack();
			}
		}

		private void chkFilter_CheckedChanged(object sender, EventArgs e)
		{
			this.UpdateDetailFilter(this.chkFilter.Checked);
		}

		public void UpdateDetailFilter(bool bShow)
		{
			if (!bShow || !this.chkFilter.Checked)
			{
				this.rdoSpecification.Enabled = false;
				this.rdoSize.Enabled = false;
				this.btnSpecification.Enabled = false;
				this.btnSize.Enabled = false;
				return;
			}
			if ((this.m_treNodeCur.Tag as FilterInfo).DetailFilter == "尺寸")
			{
				this.rdoSize.Enabled = true;
				this.rdoSize.Checked = true;
				this.rdoSpecification.Enabled = false;
				this.rdoSpecification.Checked = false;
			}
			else if ((this.m_treNodeCur.Tag as FilterInfo).DetailFilter == "规格")
			{
				this.rdoSize.Enabled = false;
				this.rdoSize.Checked = false;
				this.rdoSpecification.Enabled = true;
				this.rdoSpecification.Checked = true;
			}
			if (this.rdoSpecification.Checked)
			{
				this.btnSpecification.Enabled = true;
			}
			else
			{
				this.btnSpecification.Enabled = false;
			}
			if (this.rdoSize.Checked)
			{
				this.btnSize.Enabled = true;
				return;
			}
			this.btnSize.Enabled = false;
		}

		private void rdoSpecification_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rdoSpecification.Checked)
			{
				this.btnSpecification.Enabled = true;
				return;
			}
			this.btnSpecification.Enabled = false;
		}

		private void btnSpecification_Click(object sender, EventArgs e)
		{
			this.MakeRequest(GridRequestId.Event1);
		}

		public void btnSpecification_Click()
		{
			this.m_lstPipeMaterial.Clear();
			this.GetPipeMaterial(false);
			if (this.m_lstPipeMaterial.Count <= 0)
			{
				this.GetPipeMaterial(true);
			}
			this.m_lstSystem.Clear();
			this.GetFilterSystem(this.treeViewSystem.Nodes[0], false, ref this.m_lstSystem);
			if (this.m_lstSystem.Count <= 0)
			{
				this.GetFilterSystem(this.treeViewSystem.Nodes[0], true, ref this.m_lstSystem);
			}
			this.m_lstFilterInfo.Clear();
			this.GetFilterElement(this.treeViewElement.Nodes[0]);
			if (this.m_lstFilterInfo.Count <= 0)
			{
				YJKMessageBox.Show("没有选择构件类别");
				return;
			}
			if (this.rdoArea.Checked)
			{
				this.m_Data.GetStatisticElement(this.m_doc.ActiveView as ViewPlan, this.m_lstFilterInfo, this.m_lstSystem, this.m_lstSelElems, this.m_lstPipeMaterial);
			}
			else
			{
				this.m_Data.GetStatisticElement(base.bLink, this.m_lstViewPlan, this.m_lstFilterInfo, this.m_lstSystem, this.m_lstPipeMaterial);
			}
			if (this.m_Data.m_lstDicElement.Count <= 0)
			{
				YJKMessageBox.Show("没有统计数据");
				return;
			}
			List<string> detailFilter = this.GetDetailFilter(false);
			string afterCheckNode = this.GetAfterCheckNode();
			List<int> indexs = this.InitialSelection(this.dicSpecData, afterCheckNode, detailFilter);
			DlgDetailFilter dlgDetailFilter = new DlgDetailFilter("规格型号", detailFilter, indexs);
			if (dlgDetailFilter.ShowDialog() == DialogResult.OK)
			{
				Dictionary<ElementId, ElemParm> dictionary = this.m_Data.m_lstDicElement[0];
				foreach (ElementId key in new List<ElementId>(dictionary.Keys))
				{
					if (!dlgDetailFilter.m_lstDetailFilter.Contains(dictionary[key].DetailInfo))
					{
						dictionary.Remove(key);
					}
				}
				this.AddTempData(this.dicSpecData, afterCheckNode, dlgDetailFilter.m_lstDetailFilter);
			}
		}

		private void GetPipeMaterial(bool bSelAll)
		{
			IEnumerator enumerator = this.treeViewMaterial.Nodes[0].Nodes.GetEnumerator();
			if (bSelAll)
			{
				while (enumerator.MoveNext())
				{
					object obj = enumerator.Current;
					TreeNode treeNode = obj as TreeNode;
					this.m_lstPipeMaterial.Add(treeNode.Text);
				}
				return;
			}
			while (enumerator.MoveNext())
			{
				object obj2 = enumerator.Current;
				TreeNode treeNode2 = obj2 as TreeNode;
				if (treeNode2.Checked)
				{
					this.m_lstPipeMaterial.Add(treeNode2.Text);
				}
			}
		}

		private void rdoSize_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rdoSize.Checked)
			{
				this.btnSize.Enabled = true;
				return;
			}
			this.btnSize.Enabled = false;
		}

		private void btnSize_Click(object sender, EventArgs e)
		{
			this.MakeRequest(GridRequestId.Event2);
		}

		public void btnSize_Click()
		{
			this.m_lstPipeMaterial.Clear();
			this.GetPipeMaterial(false);
			if (this.m_lstPipeMaterial.Count <= 0)
			{
				this.GetPipeMaterial(true);
			}
			this.m_lstSystem.Clear();
			this.GetFilterSystem(this.treeViewSystem.Nodes[0], false, ref this.m_lstSystem);
			if (this.m_lstSystem.Count <= 0)
			{
				this.GetFilterSystem(this.treeViewSystem.Nodes[0], true, ref this.m_lstSystem);
			}
			this.m_lstFilterInfo.Clear();
			this.GetFilterElement(this.treeViewElement.Nodes[0]);
			if (this.m_lstFilterInfo.Count <= 0)
			{
				YJKMessageBox.Show("没有选择构件类别");
				return;
			}
			if (this.rdoArea.Checked)
			{
				this.m_Data.GetStatisticElement(this.m_doc.ActiveView as ViewPlan, this.m_lstFilterInfo, this.m_lstSystem, this.m_lstSelElems, this.m_lstPipeMaterial);
			}
			else
			{
				this.m_Data.GetStatisticElement(base.bLink, this.m_lstViewPlan, this.m_lstFilterInfo, this.m_lstSystem, this.m_lstPipeMaterial);
			}
			if (this.m_Data.m_lstDicElement.Count <= 0)
			{
				YJKMessageBox.Show("没有统计数据");
				return;
			}
			List<string> detailFilter = this.GetDetailFilter(true);
			string afterCheckNode = this.GetAfterCheckNode();
			List<int> indexs = this.InitialSelection(this.dicSizeData, afterCheckNode, detailFilter);
			DlgDetailFilter dlgDetailFilter = new DlgDetailFilter("尺寸", detailFilter, indexs);
			if (dlgDetailFilter.ShowDialog() == DialogResult.OK)
			{
				Dictionary<ElementId, ElemParm> dictionary = this.m_Data.m_lstDicElement[0];
				foreach (ElementId key in new List<ElementId>(dictionary.Keys))
				{
					if (!dlgDetailFilter.m_lstDetailFilter.Contains(dictionary[key].DetailInfo))
					{
						dictionary.Remove(key);
					}
				}
				this.AddTempData(this.dicSizeData, afterCheckNode, dlgDetailFilter.m_lstDetailFilter);
			}
		}

		private void GetFilterSystem(TreeNode node, bool bSelAll, ref List<string> lstSystem)
		{
			TreeNodeCollection nodes = node.Nodes;
			if (nodes.Count <= 0)
			{
				if (bSelAll || (!bSelAll && node.Checked))
				{
					lstSystem.Add(node.Text);
				}
				return;
			}
			for (int i = 0; i < nodes.Count; i++)
			{
				TreeNode node2 = nodes[i];
				this.GetFilterSystem(node2, bSelAll, ref lstSystem);
			}
		}

		private void GetFilterElement(TreeNode node)
		{
			if (node.Tag != null && node.Checked)
			{
				FilterInfo item = node.Tag as FilterInfo;
				this.m_lstFilterInfo.Add(item);
				return;
			}
			TreeNodeCollection nodes = node.Nodes;
			for (int i = 0; i < nodes.Count; i++)
			{
				this.GetFilterElement(nodes[i]);
			}
		}

		private void MakeRequest(GridRequestId request)
		{
			this.m_Handler.Request.Make(request);
			this.m_ExEvent.Raise();
		}

		private void DlgPlumbingFilter_FormClosing(object sender, FormClosingEventArgs e)
		{
			if (e.CloseReason == CloseReason.UserClosing)
			{
				e.Cancel = true;
				base.Hide();
				base.m_mainSetDlg.Show();
			}
		}

		protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
		{
			if (keyData == Keys.Escape)
			{
				base.Hide();
				base.m_mainSetDlg.Show();
				return true;
			}
			return base.ProcessCmdKey(ref msg, keyData);
		}

		private void DlgPlumbingFilter_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\u001b')
			{
				base.Hide();
				base.m_mainSetDlg.Show();
			}
		}

		private void treeViewMaterial_AfterCheck(object sender, TreeViewEventArgs e)
		{
			if (e.Action == TreeViewAction.ByMouse)
			{
				this.SetChildChecked(e.Node);
				if (e.Node.Parent != null)
				{
					this.SetParentChecked(e.Node);
				}
			}
		}

		private string GetAfterCheckNode()
		{
			string result = "";
			foreach (object obj in this.treeViewElement.Nodes[0].Nodes)
			{
				TreeNode treeNode = (TreeNode)obj;
				if (treeNode.Checked)
				{
					result = treeNode.Text;
					break;
				}
			}
			return result;
		}

		private void AddTempData(Dictionary<string, List<string>> dicData, string key, List<string> filterInfo)
		{
			if (dicData.Keys.Contains(key))
			{
				dicData[key] = filterInfo;
				return;
			}
			dicData.Add(key, filterInfo);
		}

		private List<int> InitialSelection(Dictionary<string, List<string>> dicData, string key, List<string> filterInfo)
		{
			List<int> list = new List<int>();
			if (dicData.Keys.Contains(key))
			{
				List<string> list2 = dicData[key];
				for (int i = 0; i < filterInfo.Count; i++)
				{
					if (list2.Contains(filterInfo[i]))
					{
						list.Add(i);
					}
				}
			}
			return list;
		}

		private string m_strFilePath = Path.Combine(Product.DataLocation, "PlumbingStatistic.xml");

		private TreeNode m_treNodeCur;

		private PlumbingMaterialStatisticData m_Data;

		private List<FilterInfo> m_lstFilterInfo = new List<FilterInfo>();

		private List<Element> m_lstSelElems;

		private ExternalCommandData m_cmmdData;

		private Document m_doc;

		private GridRequestHandlerParent m_Handler;

		private ExternalEvent m_ExEvent;

		public List<ViewPlan> m_lstViewPlan = new List<ViewPlan>();

		public List<string> m_lstSystem = new List<string>();

		private List<string> m_lstPipeMaterial = new List<string>();

		private Dictionary<string, List<string>> dicSizeData = new Dictionary<string, List<string>>();

		private Dictionary<string, List<string>> dicSpecData = new Dictionary<string, List<string>>();
	}
}
